//
//  OrganationApplyStateCell.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/10/11.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "OrganationApplyStateCell.h"

@implementation OrganationApplyStateCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _chooesImageView = [[UIImageView alloc] init];
        _chooesImageView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_chooesImageView];
        [_chooesImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(15));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(20));
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        UILabel *readLabel = [[UILabel alloc] init];
        [self.contentView addSubview:readLabel];
        readLabel.text = @"我已阅读并同意";
        readLabel.adjustsFontSizeToFitWidth = YES;
        readLabel.textAlignment = NSTextAlignmentCenter;
        [readLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_chooesImageView.mas_right).offset(scaleLeftAndRight(0));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(20));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(120), scaleTopAndBottom(15)));
        }];
        UIButton *introdBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        introdBtn.backgroundColor = [UIColor redColor];
        introdBtn.titleLabel.adjustsFontSizeToFitWidth = YES;
        [introdBtn setTitle:@"免责声明" forState:UIControlStateNormal];
        [self.contentView addSubview:introdBtn];
        [introdBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(readLabel.mas_right).offset(scaleLeftAndRight(0));
            make.top.equalTo(self.contentView.mas_top).offset(scaleTopAndBottom(20));
            make.size.mas_equalTo(CGSizeMake(scaleLeftAndRight(80), scaleTopAndBottom(15)));
        }];
        UIButton *commitBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        commitBtn.backgroundColor = [UIColor redColor];
        [commitBtn setTitle:@"提交资料" forState:UIControlStateNormal];
        commitBtn.layer.cornerRadius = scaleTopAndBottom(20);
        commitBtn.layer.masksToBounds = YES;
        [commitBtn addTarget:self action:@selector(goToSignupInformationPage:) forControlEvents:UIControlEventTouchUpInside];
        [self.contentView addSubview:commitBtn];
        [commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(scaleLeftAndRight(15));
            make.top.equalTo(readLabel.mas_bottom).offset(scaleTopAndBottom(20));
            make.right.equalTo(self.contentView.mas_right).offset(scaleLeftAndRight(-15));
            make.height.mas_equalTo(scaleTopAndBottom(40));
        }];

    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
